package com.pactera.jep.service.sys.dto;

import com.pactera.jep.sys.model.AppConfig;
import org.apache.commons.collections.CollectionUtils;

import java.util.ArrayList;
import java.util.List;

public class AppConfigDto extends AppConfig {

	private String id;

	private String title;

	private String parentId;

	private String parentName;

	List<AppConfigDto> children;

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public String getTitle() {return title;}

	public void setTitle(String title) {this.title = title;}

	public String getParentId() {
		return parentId;
	}

	public String getParentName() {
		return parentName;
	}

	public void setParentName(String parentName) {
		this.parentName = parentName;
	}

	public void setParentId(String parentId) {
		this.parentId = parentId;
	}

	public List<AppConfigDto> getChildren() {
		return children;
	}

	public void setChildren(List<AppConfigDto> children) {
		this.children = children;
	}

	public void addChildren(AppConfigDto unitDto) {
		if(CollectionUtils.isEmpty(children)) {
			this.children = new ArrayList<AppConfigDto>();
		}
		this.children.add(unitDto);
	}
}
